package com.shuwen.gcdj.common.enums;

import com.shuwen.gcdj.bean.Enum.LogType.LogTypeResp;

import java.util.ArrayList;
import java.util.List;

/**
 * @author :杨云山
 * 系统日志 类型枚举
 * @date : 2023/3/15 13:09
 */
public enum LogTypeEnum {
    LOG_TYPE_ADD(0,"添加操作"),
    LOG_TYPE_DELETE(1,"删除操作"),
    LOG_TYPE_UPDATE(2,"修改操作"),
    LOG_TYPE_SELECT(3,"查询操作"),
    LOG_TYPE_LOGIN(4,"登录操作");

    private final String typeName;

    private final Integer typeNum;

    public String getTypeName() {
        return typeName;
    }

    public Integer getTypeNum() {
        return typeNum;
    }

    LogTypeEnum(Integer typeNum, String typeName) {
        this.typeNum = typeNum;
        this.typeName = typeName;
    }

    public static List<LogTypeResp> getList(){
        LogTypeEnum[] values = values();
        List<LogTypeResp> objects = new ArrayList<>();
        for (LogTypeEnum i : values){
            LogTypeResp logTypeResp = new LogTypeResp();
            logTypeResp.setTypeNum(i.getTypeNum());
            logTypeResp.setTypeName(i.getTypeName());
            objects.add(logTypeResp);
        }
        return objects;
    }
}
